import request from '@/utils/request'

// 获取国家分页列表
export function pagCountryList(query) {
  return request({
    url: '/system/country/paging',
    method: 'get',
    params: query
  })
}

// 删除国家
export function deleteCountry(countryId) {
  if (!countryId) {
    return false
  }
  return request({
    url: '/system/country/delete',
    method: 'get',
    params: {
      countryId
    }
  })
}

// 获取国家信息
export function getCountryList(countryId) {
  const params = {}
  if (countryId) {
    params.countryId = countryId
  }
  return request({
    url: '/system/country/getCountryList',
    method: 'get',
    params: params
  })
}

// 保存国家信息，传复杂对象，参数用data
export function saveCountry(country) {
  return request({
    url: '/system/country/save',
    method: 'post',
    data: country
  })
}
